<template>
  <div class="box">
    <div class="head-fixed">
      <div class="head">
        <img src="../../assets/zjt2.png" alt="" class="back" @click="back()" />
        <div class="head-search" >已投简历</div>
      </div>
    </div>
    <div v-if="status == 0" class="content">
      <div v-for="item in list" class="block">
          <div class="block-top">
              <div>{{item.positionTitle}}</div>
              <span>{{item.addtime}}</span>
          </div>
          <div class="block-btm">
              <div>{{item.companyName}}</div>
              <span v-if="item.postStatus === 0">未查看</span>
              <span v-if="item.postStatus === 1" class="bbb">已查看</span>
          </div>
      </div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'

export default {
  inject: ['reload'],
  name: 'deliver',
  components: {},
  created () {
    this.init()
  },
  mounted () {

  },
  data () {
    return {
      // status为用户身份，0是求职者，1是招聘者/
      userId: window.localStorage.getItem('userId'),
      status: localStorage.status,
      list: [
        {
          positionTitle: 'Java开发',
          addtime: '2021-12-01',
          companyName: '大连xxxxx公司',
          postStatus: 0
        }
      ]
    }
  },
  methods: {
    init () {
      this.$http({
        method: 'get',
        params: {
          userId: this.userId
        },
        url: Vue.prototype.AppURL + '/user/getUserPost/' + this.userId
      }).then(({data}) => {
        this.list = data.post
      })
    },
    go (id) {
      if (this.status === 0) {
        this.$router.push('/post')
      }
    },
    back () {
      this.$router.push('/usersMy')
    }
  }
}
</script>

<style scoped>
html,
body,
.tac,
.box,
.tab-left,
.tab-left .el-menu {
  height: 100%;
}

.box {
  width: 100%;
  background: rgb(248, 248, 248);
}
.head-fixed {
  width: 100%;
  height: 84px;
  position: fixed;
  z-index: 999;
}
.head {
  background: #3e63a8;
  color: #fff;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.back {
  width: 14px;
  height: 14px;
}
.head div img {
  width: 20px;
  height: 20px;
}
.head-search {
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  font-size: 14px;
}
.content {
  position: relative;
  top: 40px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
}
.block{
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 2px 2px 5px #c7c7c7;
    margin-bottom: 10px;
}
.block-top,.block-btm{
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.block-top{
    margin-bottom: 10px;
}
.block-top div{
    font-size: 16px;
}
.block-top span{
    font-size: 12px;
    color: #bbb;
}
.block-btm div{
    color: #bbb;
    font-size: 14px;
}
.block-btm span{
    font-size: 14px;
    color: #3e63a8;
}
.bbb{
  color: #bbb !important;
}
</style>
